-
Notifications
You must be signed in to change notification settings - Fork 131
Update package inspector to generate SHA-512 along with SHA-1 #2324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…pdate variable names for clarity
❌ Work item link check failed. Description does not contain AB#{ID}. Click here to Learn more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the package inspector by adding SHA-512 hash generation alongside the existing SHA-1 output and suppresses a CodeQL SM05136 warning in MSAL.
- Renamed
packageSigningSha
tosigningCertificateHashes
and included SHA-512 calculation inMainActivity
. - Annotated legacy SHA-1 usage with a CodeQL suppression in
PublicClientApplicationConfiguration
. - Updated message composition to display both hash values.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
package-inspector/src/main/java/com/microsoft/inspector/MainActivity.java | Renamed variable, added SHA-512 digest, updated message assignment. |
msal/src/main/java/com/microsoft/identity/client/PublicClientApplicationConfiguration.java | Added CodeQL suppression comment for SHA-1 instantiation. |
Comments suppressed due to low confidence (2)
package-inspector/src/main/java/com/microsoft/inspector/MainActivity.java:148
- The comment "This is only for test purposes, not used in production" is misleading; update it to reflect that SHA-1 is retained for legacy support in production.
final MessageDigest digestSha1 = MessageDigest.getInstance("SHA"); // CodeQL [SM05136] This is only for test purposes, not used in production.
package-inspector/src/main/java/com/microsoft/inspector/MainActivity.java:156
- Consider adding or updating unit tests to verify both SHA-1 and SHA-512 hash generation to ensure the new SHA-512 logic is covered.
signingCertificateHashes = "SHA-1: " + packageSigningSha1 + "\nSHA-512: " + packageSigningSha512;
package-inspector/src/main/java/com/microsoft/inspector/MainActivity.java
Outdated
Show resolved
Hide resolved
package-inspector/src/main/java/com/microsoft/inspector/MainActivity.java
Outdated
Show resolved
Hide resolved
msal/src/main/java/com/microsoft/identity/client/PublicClientApplicationConfiguration.java
Show resolved
Hide resolved
…tivity.java Co-authored-by: Copilot <[email protected]>
…tivity.java Co-authored-by: Copilot <[email protected]>
Additionally, I suppress a CodeQL regarding the use of SHA-1, why because we are still using sha1 in the redirect urls and we cannot force apps to update the signature.